package com.example.demo.service.impl;

import com.example.demo.domain.Menu;
import com.example.demo.domain.Vo.menuListVo;
import com.example.demo.mapper.MenuMapper;
import com.example.demo.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 服务层
 */
@Service
public class MenuServiceImpl implements IMenuService {
   @Autowired
    private MenuMapper menuMapper;


    /**
     * 查询菜单
     * @param menu
     * @return
     */
    @Override
    public List<menuListVo> selectMenu(Menu menu) {
        return menuMapper.selectMenu(menu);
    }

    /**
     * 新增菜单
     * @param menu
     */
    @Override
    public void insertMenu(Menu menu) {
    menuMapper.insertMenu(menu);
    }

    /**
     * 修改菜单
     * @param menu
     */
    @Override
    public void updateMenuById(Menu menu) {
menuMapper.updateMenuById(menu);
    }


    /**
     * 删除菜单
     * @param id
     */
    @Override
    public void delMenuById(String id) {
 menuMapper.delMenuById(id);
    }



    @Override
    public List<Menu> getByUserId(Long userId){
        return menuMapper.getByUserId(userId);
    }



}
